<script setup>
import router from '@/router'
const props = defineProps(['item'])
const lookDetails = () => {
  router.push({ name: 'ShopDetail', params: { id: props.item.id } })
}
</script>

<template>
  <div class="shop-info" @click="lookDetails()">
    <div class="shop-img">
      <img :src="props.item.imgUrl" alt="" />
    </div>
    <div class="shop-info-content">
      <div class="shop-name">{{ props.item.name }}</div>
      <div class="shop-info-value">
        <div class="shop-info-item">月售：{{ props.item.sales }}</div>
        <div class="shop-info-item">起送：{{ props.item.expressLimit }}</div>
        <div class="shop-info-item">基础运费：{{ props.item.expressPrice }}</div>
      </div>
      <div class="discounts">{{ props.item.slogan }}</div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
@import '@/style/viriables.scss';
$left-width: 20%;
$right-width: (100%- $left-width);

.shop-info {
  width: 95%;
  height: 10vh;
  margin: 10px auto;
  display: flex;
  color: $dark-fontColor;

  & .shop-img {
    width: $left-width;
    height: 100%;
    & img {
      width: 60px;
      aspect-ratio: 1/1;
      margin: 10px;
    }
  }
  & .shop-info-content {
    height: 100%;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    width: 60%;
    font-size: 14px;
    & .shop-name {
      font-size: 17px;
    }

    & .shop-info-value {
      width: 100%;
      display: flex;
      justify-content: space-between;
    }
    & .discounts {
      color: $hightlight-fontColor;
    }
  }
}
</style>